package com.tau.iplayer.client.widgets;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Composite;
import com.tau.iplayer.client.models.Track;

public abstract class TrackDisplay extends Composite implements HasClickHandlers {
	
	public TrackDisplay(Track track) {
		createTrackDisplay(track);
	}
	/**
	 * creates the track display widget
	 * @param track the track to display
	 */
	abstract void createTrackDisplay(Track track);
	
	@Override
	public HandlerRegistration addClickHandler(ClickHandler handler) {
		return addDomHandler(handler, ClickEvent.getType());
	}
}
